//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Windows.Controls;
using OpenLS.Spreadsheet.UI.Internals;

namespace OpenLS.Spreadsheet.UI
{
    /// <summary>
    /// Interaction logic for FormatControl.xaml
    /// </summary>

    public partial class FormatControl
    {
        public FormatControl()
        {
            InitializeComponent();
        }

        
        void OnFormatChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count == 0)
                return;
            var f = (NamedFormat) e.AddedItems[0];
            var rangeFormatter = (FormatFormatter) DataContext;
            if (rangeFormatter != null)
            {
                rangeFormatter.Format = f;
               // var r = rangeFormatter.Record;

//                if (r != null)
  //                  r.SetCellValue(CellProperty.Format, f.Format);
            }
        }
    }

    
}